gl: Drop GdkGLContextClass.upload_texture()
authorEmmanuele Bassi <ebassi@gnome.org>
Mon, 9 Feb 2015 19:09:31 +0000 (19:09 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 9 Feb 2015 19:10:31 +0000 (19:10 +0000)
It's unnecessary to allow per-backend overrides.

gdk/gdkgl.c
gdk/gdkglcontext.c
gdk/gdkglcontextprivate.h

index be3d6f428e23e1a7e7c05fa6032d839108cd80fe..4eff0a6ae38f1724280670221f5a71792e217fde 100644 (file)
@@ -716,8 +716,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
       e.height *= sy;
       image = cairo_surface_map_to_image (surface, &e);
 
-      /* We might have a different alignment, stride or format, so allow overriding here if needed */
-      GDK_GL_CONTEXT_GET_CLASS (paint_context)->upload_texture (paint_context, image, e.width, e.height, target);
+      gdk_gl_context_upload_texture (paint_context, image, e.width, e.height, target);
 
       cairo_surface_unmap_image (surface, image);
 
@@ -746,6 +745,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
       }
     }
 
+#undef FLIP_Y
+
   glDisable (GL_SCISSOR_TEST);
   glDeleteTextures (1, &texture_id);
 }
index a1b1088a2fa2e4a15296d1e1b763e30a579a561c..dda1b61cd15044bfc24b353fb02e4a935a1d075e 100644 (file)
@@ -240,8 +240,7 @@ gdk_gl_context_get_property (GObject    *gobject,
     }
 }
 
-/* Default implementation of upload_texture() for gdk_gl_texture_from_surface() */
-static void
+void
 gdk_gl_context_upload_texture (GdkGLContext    *context,
                                cairo_surface_t *image_surface,
                                int              width,
@@ -332,9 +331,6 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
   gobject_class->dispose = gdk_gl_context_dispose;
   gobject_class->finalize = gdk_gl_context_finalize;
 
-  /* Default Implementation of upload_texture() for gdk_gl_texture_from_surface() */
-  klass->upload_texture = gdk_gl_context_upload_texture;
-
   g_object_class_install_properties (gobject_class, LAST_PROP, obj_pspecs);
 }
 
index 0bd5d14476e9102757dd780bc39eb21afabfc619..668dd0e2ac08c84ba3fdf36a1026df39b3c78e80 100644 (file)
@@ -49,11 +49,6 @@ struct _GdkGLContextClass
   gboolean (* texture_from_surface) (GdkGLContext    *context,
                                      cairo_surface_t *surface,
                                      cairo_region_t  *region);
-  void (* upload_texture) (GdkGLContext    *context,
-                           cairo_surface_t *image_surface,
-                           int              width,
-                           int              height,
-                           guint            texture_target);
 };
 
 typedef struct {
@@ -74,13 +69,18 @@ typedef struct {
   GdkGLContextProgram *current_program;
 } GdkGLContextPaintData;
 
-GdkGLContextPaintData * gdk_gl_context_get_paint_data           (GdkGLContext   *context);
-gboolean                gdk_gl_context_use_texture_rectangle    (GdkGLContext   *context);
-gboolean                gdk_gl_context_has_framebuffer_blit     (GdkGLContext   *context);
-gboolean                gdk_gl_context_has_frame_terminator     (GdkGLContext   *context);
-void                    gdk_gl_context_end_frame                (GdkGLContext   *context,
-                                                                 cairo_region_t *painted,
-                                                                 cairo_region_t *damage);
+void                    gdk_gl_context_upload_texture           (GdkGLContext    *context,
+                                                                 cairo_surface_t *image_surface,
+                                                                 int              width,
+                                                                 int              height,
+                                                                 guint            texture_target);
+GdkGLContextPaintData * gdk_gl_context_get_paint_data           (GdkGLContext    *context);
+gboolean                gdk_gl_context_use_texture_rectangle    (GdkGLContext    *context);
+gboolean                gdk_gl_context_has_framebuffer_blit     (GdkGLContext    *context);
+gboolean                gdk_gl_context_has_frame_terminator     (GdkGLContext    *context);
+void                    gdk_gl_context_end_frame                (GdkGLContext    *context,
+                                                                 cairo_region_t  *painted,
+                                                                 cairo_region_t  *damage);
 
 G_END_DECLS